package com.youlu.campus.admin.data.controller;

import com.youlu.campus.admin.utils.AuthUtils;
import com.youlu.campus.entity.VO.OrderStatisticsQueryV0;
import com.youlu.campus.service.data.OrderStatisticsService;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderStatisticsController {
    @Autowired
    private OrderStatisticsService orderStatisticsService;

    @PostMapping("/orders/statistics/allocation")
    public QResult hourData(@RequestBody OrderStatisticsQueryV0 req) {
        String userId = AuthUtils.getUserId();
        return QResult.success(orderStatisticsService.get(req, userId));
    }
}
